package com.example.schoolenterprisealliance.activity;

import android.content.Intent;
import android.os.Bundle;

import com.example.schoolenterprisealliance.io.MyBitmap;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;

import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.schoolenterprisealliance.R;

import java.io.IOException;

public class ItemAdminActivity extends AppCompatActivity {
    private TextView tv_name;
    private TextView tv_position;
    private TextView tv_introduce;
    private ImageView iv_left;
    private Button bt_return;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.item_admin_left);
        tv_name=findViewById(R.id.tv_name_left);
        tv_position=findViewById(R.id.tv_position_left);
        tv_introduce=findViewById(R.id.tv_introduce_left);
        iv_left=findViewById(R.id.iv_left);
        bt_return=findViewById(R.id.button_left);
        Intent intent=getIntent();
        tv_name.setText(intent.getStringExtra("username"));
        tv_position.setText(intent.getStringExtra("position"));
        tv_introduce.setText(intent.getStringExtra("context"));
        try {
            iv_left.setImageBitmap(MyBitmap.getBitmap(intent.getStringExtra("certificate")));
        } catch (IOException e) {
            e.printStackTrace();
        }
        bt_return.setText("返回");
        bt_return.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

}
